<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>反序列化</title>
    <script type="text/javascript" src="http://jic.betools.vip/common/web/js/jquery.min.js"></script>
    <script type="text/javascript" src="http://jic.betools.vip/tools/js/json.js"></script>
</head>
<body>
    <textarea rows="20" cols="80" id="source">a:3:{s:4:"name";s:6:"huqian";s:3:"sex";s:3:"男";s:3:"age";i:27;}</textarea>
    <br>
    <textarea rows="20" cols="80" id="json"></textarea>
    <br>
    <textarea rows="20" cols="80" id="php"></textarea>
    <br>
    <button id="format">反序列化</button>
    <script>
    $("#format").click(function(){
        var content = $("#source").val();
        $.post("/convertapi/phpunserialize", {"content":content}, function(data){
            var jsonContent = data.jsonContent;
            $("#json").val(jsonContent);

            var phpContent = data.phpContent;
            $("#php").val(phpContent);
        }, 'json');
    });
    </script>
</body>
</html>
